package com.lzy.cloud.order.constants;

import java.util.ArrayList;
import java.util.List;

public class OrderBusiConstants {

    public enum OrderTypeEnum {
        TOURCARSALE(1, "房车销售"), TOURCARRENT(2, "房车租赁"), CAMP(3, "露营地"), OUTDOOR(4, "户外装备"),
        LINE(5, "路线"), PLAY(6, "玩什么"), GUIDE(7, "旅游创客"), PROMOTION(8, "都在玩"), MOTOR_COUPON(11, "汽摩项目"), DREAM_PLAN(13, "圆梦行动"),QUEEN_PLAN(14, "女王行动");

        private Integer type;

        private String name;

        public Integer getType() {
            return type;
        }

        public void setType(Integer type) {
            this.type = type;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        private OrderTypeEnum(Integer type, String name) {
            this.type = type;
            this.name = name;
        }

        /**
         * 获取name
         *
         * @param type
         * @return
         */
        public static String getName(Integer type) {
            for (OrderTypeEnum c : OrderTypeEnum.values()) {
                if (c.getType().equals(type)) {
                    return c.getName();
                }
            }
            return "";
        }
    }

    public enum PayStatusEnum {

        NOPAY(0, "未付款"), YESPAY(1, "已付款"), FAILPAY(2, "付款失败");

        private PayStatusEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @param type
         * @return
         */
        public static String getV(Integer type) {
            for (PayStatusEnum c : PayStatusEnum.values()) {
                if (c.getK().equals(type)) {
                    return c.getV();
                }
            }
            return "";
        }

    }

    public enum RefundEnum {
        // 0退货退款、1仅退款、2换货

        GOODANDMONEY(0, "退货退款"), MONEY(1, "仅退款"), GOOD(2, "换货");

        private RefundEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @param k
         * @return
         */
        public static String getV(Integer k) {
            for (RefundEnum c : RefundEnum.values()) {
                if (c.getK().equals(k)) {
                    return c.getV();
                }
            }
            return "";
        }

        /**
         * 获取list
         */
        public static List<InnerRefund> getEnumList() {
            List<InnerRefund> list = new ArrayList<InnerRefund>();
            for (RefundEnum c : RefundEnum.values()) {
                // TODO 单例
                list.add(c.new InnerRefund(c.getK(), c.getV()));

            }
            return list;
        }

        private class InnerRefund {
            // 值
            private Integer k;
            // 描述
            private String v;

            public Integer getK() {
                return k;
            }

            public void setK(Integer k) {
                this.k = k;
            }

            public String getV() {
                return v;
            }

            public void setV(String v) {
                this.v = v;
            }

            private InnerRefund(Integer k, String v) {
                super();
                this.k = k;
                this.v = v;
            }

        }

    }

    public enum VerifyStatusEnum {
        NOSHOW(0, "不显示"), VERIFY(1, "未审核"), YESVERIFY(2, "审核通过"), NOVERIFY(3, "审核未通过");

        private VerifyStatusEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取name
         *
         * @param type
         * @return
         */
        public static String getV(Integer type) {
            for (VerifyStatusEnum c : VerifyStatusEnum.values()) {
                if (c.getK().equals(type)) {
                    return c.getV();
                }
            }
            return "";
        }

    }

    public enum GoodsStatusEnum {
        NOSEND(0, "未发货"), YESSEND(1, "已发货");

        private GoodsStatusEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @param type
         * @return
         */
        public static String getV(Integer type) {
            for (GoodsStatusEnum c : GoodsStatusEnum.values()) {
                if (c.getK().equals(type)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

    public enum CarActionTypeEnum {
        PICK(0, "提车"), RETURN(1, "还车");

        private CarActionTypeEnum(Integer k, String v) {
            this.k = k;
            this.v = v;
        }

        private Integer k;
        private String v;

        public Integer getK() {
            return k;
        }

        public void setK(Integer k) {
            this.k = k;
        }

        public String getV() {
            return v;
        }

        public void setV(String v) {
            this.v = v;
        }

        /**
         * 获取v
         *
         * @param type
         * @return
         */
        public static String getV(Integer type) {
            for (CarActionTypeEnum c : CarActionTypeEnum.values()) {
                if (c.getK().equals(type)) {
                    return c.getV();
                }
            }
            return "";
        }
    }

//    1-余额抵扣金额，4-在线支付部分，5-龙珠、积分，6-房车券，7-房车代金券，95-不计免赔费，96-保险费，97-平台服务费，98-运费，99-商品总价
    public enum OrderExpenseItemEnum {
        BALANCE_DEDUCTION(1, "余额抵扣金额"),ONLINE_PAYMENT(4, "在线支付部分"),
        LZ_INTEGRAL(5, "龙珠、积分"), CAR_COUPON(6, "房车券"), CAR_AGENT_COUPON(7, "房车代金券"),
        NON_DEDUCTIBLE(95, "不计免赔费"), INSURANCE(96, "保险费"),
        PLATFORM_SERVICE(97, "平台服务费"),FREIGHT(98, "运费"),COMMODITY_PRICE(99, "商品总价");

        private Integer type;

        private String name;

        public Integer getType() {
            return type;
        }

        public void setType(Integer type) {
            this.type = type;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        private OrderExpenseItemEnum(Integer type, String name) {
            this.type = type;
            this.name = name;
        }

    // 阶段
    public static final class CarRentStage {
        /** 第一阶段 */
        public static final String FIRST = "1";
        /** 第二阶段 */
        public static final String SENCOND = "2";
        /** 第三阶段 */
        public static final String THIRD = "3";
    }

    }

    /**
     * 卡券状态
     */
    public enum CouponStatus {
        UNBIND(1, "未绑定"), BIND(2, "已绑定"), USERD(3, "已使用"), EXPIRED(4, "已过期"), EXPIRING(5, "即将过期");
        private String desc;
        private Integer code;

        CouponStatus(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }
    }
}
